home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
COMMS
/
WATCHRING.ZIP
/
!WatchRing
/
!Help
next >
Wrap
Text File
|
1997-05-06
|
8KB
|
171 lines
WatchRing
version 2.10 (6 May 1997)
by Rick Hudson
rick@actrix.gen.nz
http://www.geocities.com/CapeCanaveral/Lab/6722
This is release 2 of WatchRing - a simple program that simply makes a noise
when your modem detects the phone ringing.
The latest version of this program can be found on the web page shown above.
License: WatchRing is FreeWare and may be freely distributed in its original
archive form provided there is no charge for it. Files within the archive may
not be distributed separately or with any other software.
Disclaimer: This software is supplied 'as is' and I cannot guarantee that it
will work on your computer/modem setup. You use this program at your own risk
and I will not accept responsibility for any 'effects' (including crashes)
caused by the use of this program. I would nevertheless be interested to hear
any problems you may have.
The application
===============
WatchRing is supplied in a dummy application form so that it can be run by
just double clicking on it or it can be dropped in the tasks directory of
your boot structure. You can of course start the module manually from a
command script or edit the !Run file for your own requirements. You *can*
just double-click on the module but it will default to the system beep as its
ring sound.
The two versions
================
There are currently two version of WatchRing. They both do the same thing but
one (WR_RI) detects the ringing by monitoring the RI (Ring Indicator) line on
the serial port. This requires your modem to be connected by a standard
PC-style serial cable which connects the modem's RI to the computer's RI. It
also requires that your modem does in fact pulse the RI line high when the
phone rings. Old-style cables with wires crossed all over the place will not
work with this version.
The other (WR_TX) detects the ringing by looking for the character sequence
<CR><LF>RING<CR><LF>. Most modems generate this string when they detect the
phone ringing and it should therefore work with most modems. The only thing
is the OS serial buffering needs to be enabled first. WR_TX enables it when
it starts (using OS_Byte 2,2) but some comms programs might disable it again
when they quit (eg Connector does this). BTW the TX suffix comes from the
fact that it monitors text coming from the modem to do the job.
Configuration
=============
WatchRing can do one of three things when it detects a ring. This is common
to both versions. The action is controlled by parameters on start-up:
BEEP do a plain old system beep. No more parameters.
PLAY <p1> <p2> <p3> <p4> execeute a sound command. The parameters are
exactly as documented by the Sound_Control SWI. ie p1=channel,
p2=amlpitude, p3=pitch, p4=duration.
COMM <command> execute a CLI command. All text after COMM is
passed to the CLI, including any more parameters. Commands requiring disc
access should be avoided!
If you have a normal sound module installed as a voice then the PLAY option
will be the one you will use to make it work. Experiment with the *Sound
command first if you need to.
The module PhoneRing supplied in the archive will install as a transient
voice. The sound system is unaware of it until the command SPlay_PhoneRing is
executed.
You can create normal voice modules and transient voice modules using
SoundCon - a sound conversion utility also written by Rick Hudson. It can be
found on Hensa (d044) and my web page should you want/need it.
The RI version has some additonal * commands to further refine the operation:
*WR_PulseLen <min length> <max length>
This sets the range of pulse lengths that WatchRing will repsond to. The
parameters are in centiseconds. When your modem detects a ring the RI line is
set to the high state for the duration of the ring (eg in New Zealand this is
nominally 50 centiseconds per ring). The idea is to filter out bogus rings.
A setting of 0 0 (actually only max=0 is checked) will disable the pulse
filtering and all rising edges are candidates for making a noise. Note that
when pulse filtering is used WatchRing must wait for the end of the pulse
(the falling edge) before it can decide whether to make a noise since it
needs to time the pulse length before checking it against the allowed range.
Example: When I switch my modem off RI goes high for about 1.3 seconds, and
when I switch it off it goes high for about 0.1 seconds. These bogus rings
are due to the transient state of the power and the modem has little control
over its electronics during these periods. By specifying "WR_PulseLen 20 80"
this filters out the problem. The range could be smaller but it pays to be
conservative.
There is a small Basic program in the archive called RI_Timing which you can
run to measure the timing of your telephone system (or more accurately, your
modem's repsonse to it). Of course you need to make your telephone ring to
get any information! WatchRing need not be running to use this.
*WR_MinRepeat <time>
This controls the minimum period (in centiseconds) between successive
'noises' played by WatchRing. This is to allow longish samples to complete
before being interrupted by another ring. For example if you play a sample
that lasts 2.3 seconds you might want to set a minimum repeat of 3 seconds
(ie *WR_MinRepeat 300). The default of zero allows WatchRing to make noises
at will (well, subject to the phone ringing, of course).
*WR_Flash <time> [<red> <green> <blue>]
This controls the border flashing option. The border is changed to the given
colour at the same time the sound is played and changes back to the previous
colour after <time> centiseconds. The pulse filtering also applies to the
flashing but the minimim repeat does not. If a new ring is detected while the
border is still 'flashed' nothing will happen.
The r,g,b components are all in the 0..255 range. The default colour is
255,0,0 (red).
A <time> of zero (the default) disables the flashing. You can specify a time
only (ie omit the colour) to change the flash time without affecting the
flash colour.
Differences between the versions
================================
There may be some difference in the behaviour of WR_TX and WR_RI depending on
your modem. With the modem this was tested on and the New Zealand telephone
system (which has the double-ringing style), the RI version pulses twice for
each complete 'ring' (ie once for each audible ring) whereas the TX version
only receives one "RING". If you want to duplicate such a phone ringing you
would need to have your sample play both rings for TX version and just a
single ring for the RI version. Furthermore the RI usually corresponds
directly to what you can hear on a normal phone but the "RING" string is
received after the ring as completed so that the computer will 'ring' in
between the rings of a telephone.
Another 'feature' of the RI version is that when the modem is switched on or
off the RI line may go high at some stage causing a false ring to occur. This
doesn't happen with the TX version. See the command WR_PulseLen (above) for
ideas about avoiding this with the RI version.
History:
1.00 First released version
1.10 Rewrote module because I lost the source code! Fixed bug in voice
module generator that sometimes caused voice to be left as system bell.
2.00 New version with RI sensing and 3 action options.
2.10 New commands to allow pulse length filtering and minimum repeat period.
Implemented PLAY mode which previously ignored paramaters.
Implemented border flashing as visual indicator.